//
//  leafSprite.m
//  StarBugs
//
//  Created by ?? ? on 3/21/12.
//  Copyright 2012 antisword@playorca.com. All rights reserved.
//

#include "Object/LeafSprite.h"
#include "Util/ImageManager.h"

LeafSprite::LeafSprite()
{
    mainSprite = ImageManager::getSpriteWithXml2(kImagesheet_GameSource, "item_leaf");
    addChild(mainSprite);
    bubble = ImageManager::getSpriteWithXml2(kImagesheet_GameSource, "item_bubble");
    bubble->setPosition(ccp(mainSprite->getContentSize().width/2,mainSprite->getContentSize().height/2 ));
    mainSprite->addChild(bubble);
    CCScaleTo *scale = CCScaleTo::create(0.3, 1.1, 0.9);
    CCScaleTo *scale2 = CCScaleTo::create(0.3, 0.9, 1.1);
    bubble->runAction(CCRepeatForever::create((CCActionInterval*)CCSequence::create(scale, scale2, NULL)));
    objectType = objectType_leaf;
}

void LeafSprite::setBody(b2World* _world)
{
    mainSprite->setPosition(position);
}

void LeafSprite::eatLeaf()
{
    
}
